﻿namespace Useful.MVP2
{
    public abstract class BaseListPresenterT<ListT, ItemT, M, R, V> : BaseListPresenter<M, V, R>
        where ListT : class
        where ItemT : class, new()
        where M : BaseListModelT<ListT>, new()
        where R : IRepository<ListT, ItemT>
        where V : IListViewT<ListT, ItemT>
    {
        protected BaseListPresenterT(V view, R repository, IPresenterImpl presenterImpl)
            : base(view, repository, presenterImpl)
        {
        }

        protected override void OnEditClicked(object item)
        {
            OnEditClicked((ItemT)item);
        }

        protected override void OnDeleteClicked(object item)
        {
            OnDeleteClicked((ItemT)item);
        }

        protected override void OnCurrentItemPositionChanged(object item)
        {
            OnCurrentItemPositionChanged((ItemT)item);
        }

        protected abstract void OnEditClicked(ItemT item);
        protected abstract void OnDeleteClicked(ItemT item);
        protected abstract void OnCurrentItemPositionChanged(ItemT item);
    }
}
